﻿using Basic.FormCollect;
using Basic.FormLocalEvent.Model;
using Basic.FormRemoteModel;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;

namespace Basic.FormLocalEvent.Form
{
    [LocalEventName("Delete")]
    internal class ClearQueryColumn : IEventHandler<FormEvent>
    {
        private readonly IQueryColumnCollect _Service;

        public ClearQueryColumn ( IQueryColumnCollect service )
        {
            this._Service = service;
        }

        public void HandleEvent ( FormEvent data, string eventName )
        {
            if ( data.Form.FormType == FormType.物理表单 )
            {
                this._Service.Clear(data.Form.Id);
            }
        }
    }
}
